<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateQuizOptionsTable extends Migration
{
    const TABLE = 'quiz_options';

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create(static::TABLE, function (Blueprint $table) {
            $table->uuid('id');
            $table->uuid('quiz_id');
            $table->string('text');
            $table->string('resource')->nullable(); // 资源，图片或者其他
            $table->unsignedTinyInteger('fillable')->default(0);
            $table->unsignedTinyInteger('fill_required')->default(0);
            $table->unsignedInteger('sort')->default(0); // 排序
            $table->softDeletes();
            $table->timestamps();

            $table->primary('id');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists(static::TABLE);
    }
}
